//
//  FMDiantaiCollectionViewCell.m
//  PsychologyFM
//
//  Created by lanou on 16/1/13.
//  Copyright © 2016年 ZhangLuDu. All rights reserved.
//

#import "FMDiantaiCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@implementation FMDiantaiCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _coverImgView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 0, 80, 80)];
        _coverImgView.layer.cornerRadius = 40;
        _coverImgView.layer.masksToBounds = YES;
        [self.contentView addSubview:_coverImgView];
        
        _titelLabel = [[UILabel alloc]initWithFrame:CGRectMake(_coverImgView.left, _coverImgView.bottom + 5, _coverImgView.width, 20)];
        _titelLabel.textColor = FMGray;
        _titelLabel.textAlignment = NSTextAlignmentCenter;
        _titelLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titelLabel];
        
//        _coverImgView.backgroundColor = FMGreen;
//        _titelLabel.backgroundColor = FMGreen;
    }
    return self;
}

- (void)setModel:(FMDiantaiModel *)model
{
    _model = model;
    [_coverImgView sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:nil completed:nil];
    _titelLabel.text = model.title;
}

@end
